package cn.shutdown.demo.thread.interrupt.stop;

/**
 * @author jiangwujie
 * @date 2021/8/9
 */
public class MyThread extends Thread {

    private int i = 0;

    @Override
    public void run() {
        try {
            while (true) {
                i++;
                System.out.println(i);
                Thread.sleep(1000);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ThreadDeath threadDeath) {
            threadDeath.printStackTrace();
        }
    }
}
